package com.lxl;

public class Market {
    private String MarkerName;
    private Product[] products;

    public String getMarkerName() {
        return MarkerName;
    }

    public void setMarkerName(String markerName) {
        MarkerName = markerName;
    }

    public Product[] getProducts() {
        return products;
    }

    public void setProducts(Product[] products) {
        this.products = products;
    }


    Product sell(String name) {
        for (int i = 0; i < products.length; i++) {
            if (name == products[i].getProName()) {
                return products[i];
            }
        }
        return null;
    }
}
